<%@ page language="java" import="java.util.*"
	import="com.gxuwz.medical.domain.institution.*"
	import="com.gxuwz.medical.domain.area.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="../../css/pintuer.css">
<link rel="stylesheet" href="../../css/admin.css">
<script src="../../js/jquery-1.4.4.min.js"></script>
<script src="../../js/pintuer.js"></script>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
</head>
<body>
	<%
		String agencode = request.getParameter("agencode");
		agencode = new String(agencode.getBytes("ISO-8859-1"), "UTF-8");
		Institution institution = new Institution();
		institution.setAgencode(agencode);
		institution = institution.query();
	%>
	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>修改农合机构信息</strong>
		</div>
		<div class="body-content">
			<form method="post" class="form-x"
				action="<%=path%>/system/InstitutionServlet?method=edit">
				<div class="form-group">
					<div class="label">
						<label>农合机构编码：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50"
							value="<%=institution.getAgencode()%>" name="agencode"
							disabled="disabled" /> <input type="text" class="input w50"
							value="<%=institution.getAgencode()%>" name="agencode"
							style="display: none" />
					</div>
				</div>


				<div class="form-group">
					<div class="label">
						<label>农合机构名称：</label>
					</div>
					<div class="field">
						<input type="text" class="input w50" value="<%=institution.getAgenname() %>" name="agenname"
							data-validate="required:请输入农合机构名称" />
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>所属行政区域：</label>
					</div>
					<div class="field">
						<select name="areacode">
							<%
								Area a = new Area();
								List<Area> list = a.queryAll();
								for (int i = 0; i < list.size(); i++) {
							%>
							<option value="<%=list.get(i).getAreacode()%>"
								<%if (list.get(i).getAreacode().equals(institution.getAreacode())) {%>
								selected="selected">
								<%
									} else {
								%> >
								<%
									}
								%>
								<%
									out.print("|");
										for (int t = 0; t < list.get(i).getArealevel() - 1; t++) {
											out.print("—");
										}
								%>
								<%=list.get(i).getAreaname()%>
							</option>
							<%
								}
							%>
						</select>
					</div>
				</div>


				<div class="form-group">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button class="button bg-main icon-check-square-o" type="submit">
							提交</button>
					</div>
				</div>

			</form>
		</div>
	</div>

</body>
</html>